<?php
	FLEA::loadClass('FLEA_Db_TableDataGateway');

	class	Model_Client	extends		FLEA_Db_TableDataGateway
	{
		var		$tableName		=	'client';
		var		$primaryKey		=	'ClientID';
		
		function 	findAllClients()
		{
			$sql	=	
				"
				select client.* , user.FirstName, user.LastName , user.Email,
				user.Address,user.City,user.State,user.Country,user.PostalCode,
				user.WorkPhone,user.HomePhone,user.CellPhone,user.BService from user,client
				where client.UserID=user.UserID";
			$inventors	=	$this->findBySql($sql);
			return $inventors;
		}
		/**
		 * get client information
		 *
		 * @param int $clientID
		 * @return array
		 */
		function	findClient($clientID)
		{
			$sql	=	
				"
				select client.* , user.FirstName, user.LastName , user.Email,
				user.Address,user.City,user.State,user.Country,user.PostalCode,
				user.WorkPhone,user.HomePhone,user.CellPhone,user.BService from user,client
				where client.UserID=user.UserID and client.ClientID=".$clientID;
			$clients	=	$this->findBySql($sql);
			return $clients[0];
		}

	}
?>